# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-pdfminer3k
pkgver=1.3.1
pkgrel=11
pkgdesc='PDF parser and analyzer.'
url='https://pypi.org/project/pdfminer3k/'
arch=('any')
license=('MIT')
depends=('python')
makedepends=('python-setuptools')
source=("https://pypi.python.org/packages/8c/87/cee0aa24f95c287020df7e3936cb51d32b34b05b430759bac15f89ea5ac2/pdfminer3k-$pkgver.tar.gz")
sha512sums=('7d6e3aa1a3c004d2356c3db7a4a2e75413f9cef3707d7c81c28b668bd882ffaac90543e4496cf4e36e281176248d8510cc759a82548d6237bc33da7b7ab5ba44')

build() {
  cd "pdfminer3k-$pkgver"

  python setup.py build
}

package() {
  cd "pdfminer3k-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build

  for i in dumppdf latin2ascii pdf2txt
  do
    mv "$pkgdir/usr/bin/${i}.py" "$pkgdir/usr/bin/${i}3k.py"
  done
}

